package com.fr.base.core.image4j.io;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class LittleEndianOutputStream extends DataOutputStream
{
  public LittleEndianOutputStream(OutputStream paramOutputStream)
  {
    super(paramOutputStream);
  }

  public void writeShortLE(short paramShort)
    throws IOException
  {
    paramShort = EndianUtils.swapShort(paramShort);
    super.writeShort(paramShort);
  }

  public void writeIntLE(int paramInt)
    throws IOException
  {
    paramInt = EndianUtils.swapInteger(paramInt);
    super.writeInt(paramInt);
  }

  public void writeFloatLE(float paramFloat)
    throws IOException
  {
    paramFloat = EndianUtils.swapFloat(paramFloat);
    super.writeFloat(paramFloat);
  }

  public void writeLongLE(long paramLong)
    throws IOException
  {
    paramLong = EndianUtils.swapLong(paramLong);
    super.writeLong(paramLong);
  }

  public void writeDoubleLE(double paramDouble)
    throws IOException
  {
    paramDouble = EndianUtils.swapDouble(paramDouble);
    super.writeDouble(paramDouble);
  }

  public void writeUnsignedInt(long paramLong)
    throws IOException
  {
    int i = (int)(paramLong >> 24);
    int j = (int)(paramLong >> 16 & 0xFF);
    int k = (int)(paramLong >> 8 & 0xFF);
    int l = (int)(paramLong & 0xFF);
    write(i);
    write(j);
    write(k);
    write(l);
  }

  public void writeUnsignedIntLE(long paramLong)
    throws IOException
  {
    int i = (int)(paramLong >> 24);
    int j = (int)(paramLong >> 16 & 0xFF);
    int k = (int)(paramLong >> 8 & 0xFF);
    int l = (int)(paramLong & 0xFF);
    write(l);
    write(k);
    write(j);
    write(i);
  }
}